import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Find from '@/views/find.vue'
import Index from '@/views/index.vue'
import Info from '@/views/info.vue'
import My from '@/views/my.vue'
import City from '@/views/city.vue'
// 懒加载
// const My=()=>import('@/')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [
      { path: '/find', component: Find },
      { path: '/index', component: Index },
      { path: '/info', component: Info },
      { path: '/my', component: My }
    ]
  },
  { path: '/city', component: City }
]

const router = new VueRouter({
  routes
})

export default router
